import JJRequest from './request/request'

const jjRequest = new JJRequest({
  baseURL: process.env.VUE_APP_BASE_URL,
  timeout: process.env.VUE_APP_TIME_OUT,
  interceptors: {
    requestInterceptor: (config) => {
      console.log('实例请求拦截,封装顺序2')
      const token = 'this ia a token'
      if (token) {
        config.headers.Authorization = `Bearer ${token}`
      }
      return config
    },
    responseInterceptor: (res) => {
      console.log('实例响应拦截,封装顺序2')
      return res
    }
  }
})

export default jjRequest
